package com.example.librarymanagement.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.librarymanagement.dao.BookMapper;
import com.example.librarymanagement.dto.book.BookListDto;
import com.example.librarymanagement.entity.Book;
import com.example.librarymanagement.service.IBookService;
import com.example.librarymanagement.vo.BookVo;
import org.springframework.stereotype.Service;

/**
 * @author zjia
 */
@Service
public class IBookServiceImpl extends ServiceImpl<BookMapper, Book> implements IBookService {

    @Override
    public IPage<BookVo> getBookList(BookListDto bookListDto) {

        Page<BookVo> page = new Page<>(bookListDto.getCurrent(), bookListDto.getSize());
        return baseMapper.getBookList(page, bookListDto);
    }

}
